package com.hncc.kumao.dao.impl;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Restrictions;
import com.hncc.kumao.dao.IBreakpointUploadTaskDao;
import com.hncc.kumao.entity.BreakpointUploadTask;
/**
 * 数据访问类
 * @author Administrator
 *
 */
public class BreakpointUploadTaskDao extends BaseDao<BreakpointUploadTask> implements IBreakpointUploadTaskDao {

	
	/**
	 * 构建查询条件
	 * @param dep1
	 * @param dep2
	 * @param param
	 * @return
	 */
	public DetachedCriteria getDetachedCriteria(BreakpointUploadTask breakpointUploadTask1,BreakpointUploadTask breakpointUploadTask2,Object param){
		DetachedCriteria dc=DetachedCriteria.forClass(BreakpointUploadTask.class);
		if(breakpointUploadTask1!=null){
		
		}		
		return dc;
	}
	
	/**
     * 统计任务状态
     */
    public List getTaskStateInfo() {
        //hql查询语句
        String hql = "select new Map(bu.state as state, count(0) as number) "
                + "from BreakpointUploadTask bu group by bu.state";
        //执行查询
        List list = getHibernateTemplate().find(hql);
        return list;
    }
}

